>> Let's look at how you can write,
deploy and monitor Cloud Functions. You can write the code
for Cloud Functions as node.js functions
in an index.js file. A background function takes an event
and callback function as input parameters, and HTTP function takes request and
response objects as input parameters. You do not need to upload zip files
with package dependencies. You can specify dependencies
in a package.json file. The Cloud Function service
automatically installs all dependencies
before running your code. Cloud Functions provides access
to a local disk mount point/temp that you can use
for temporary file processing. Writing to the /temp location
uses the memory that you have allocated
to your function. Make sure to clean up
any temporary files. You can deploy your function
from your local machine by using the Cloud Console
or the G Cloud command. The G Cloud command
automatically zips your code and uploads it to the Cloud storage
staging bucket that you specify. You can also deploy
your code directly from an independent
Google Cloud source repository, or from a Cloud source repository
that is automatically synchronized with a GitHub
or Bitbucket repository. You can view the output
from your console dot log and console dot error messages
in Cloud logging. If your code throws errors,
or in case of other uncaught errors, Cloud Functions automatically captures
these errors in error reporting. If you only want to report
these errors to error reporting without throwing
the error up to the caller, you can programmatically report
these errors to error reporting. In the Cloud console,
you can view function metrics related to the number
of invocations, execution time,
and memory usage.